package com.srd.phone.bean;

import android.text.TextUtils;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;


public class TenderInvestUserInfo implements Serializable {

    public int id; //用户ID
    public String menum;//客户商户号
    public String rep;//客服代表
    public int mandated;//是否托管账户
    public int grade;//信用积分
    public int credit;//信用等级
    public String tradepas; //	交易密码
    public double account; //	账户金额
    public int blacklist; //是否加入黑名单

    public static TenderInvestUserInfo parse(String json) {
        TenderInvestUserInfo info = new TenderInvestUserInfo();
        if (TextUtils.isEmpty(json)) {
            return info;
        }
        try {
            JSONObject jsonObject = new JSONObject(json);
            info.id = jsonObject.optInt("id");
            info.menum = jsonObject.optString("menum");
            info.rep = jsonObject.optString("rep");
            info.mandated = jsonObject.optInt("mandated");
            info.grade = jsonObject.optInt("grade");
            info.credit = jsonObject.optInt("credit");
            info.tradepas = jsonObject.optString("tradepas");
            info.account = jsonObject.optDouble("account", 0);
            info.blacklist = jsonObject.optInt("blacklist");
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return info;
    }
}
